import model.Item;
import model.Order;
import model.enums.ItemType;
import service.OrderService;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 方法体，程序的主要逻辑代码写在这里

        // 主食类
        Item hamburger = new Item("H001", "汉堡", 15.0, ItemType.MAIN);
        Item fries = new Item("F002", "薯条", 15.0, ItemType.MAIN);
        Item chickenWrap = new Item("W003", "鸡肉卷", 12.0, ItemType.MAIN);

        // 饮料类
        Item icedCoffee = new Item("C004", "冰咖啡", 10.0, ItemType.DRINK);
        Item cola = new Item("C005", "可乐", 8.0, ItemType.DRINK);
        Item orangeJuice = new Item("J006", "橙汁", 9.0, ItemType.DRINK);

        // 甜品类
        Item iceCream = new Item("D007", "冰淇淋", 6.0, ItemType.DESSERT);
        Item cake = new Item("D008", "蛋糕", 12.0, ItemType.DESSERT);

        //当天下午四点时间
        // 获取当前日期
        LocalDate currentDate = LocalDate.now();
        // 定义下午 4 点的时间
        LocalTime fourPM = LocalTime.of(17, 0);
        // 结合当前日期和下午 4 点的时间创建 LocalDateTime 实例
        LocalDateTime dateTimeAt4PM = LocalDateTime.of(currentDate, fourPM);

        while (true){

            ArrayList<Item> items = new ArrayList<>();
            items.add(hamburger);
            items.add(fries);
            items.add(fries);
            OrderService orderService = new OrderService();
            Order order = orderService.createOrder(items, false, dateTimeAt4PM);
            System.out.println(order);


            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            System.out.println(a);
            HashMap all = orderService.getAll();
            return;
        }
    }
}
